home *** CD-ROM | disk | FTP | other *** search
/ PC Users 8 / Cd Pc Users extra 8.iso / prog / inst / listx / setup.exe / MLIST4.FRM (.txt) < prev    next >
Encoding:
Visual Basic Form  |  1997-11-12  |  8.7 KB  |  276 lines

  1. VERSION 5.00
  2. Begin VB.MDIForm MDIForm1 
  3.    BackColor       =   &H8000000C&
  4.    Caption         =   "Mabry Software"
  5.    ClientHeight    =   6795
  6.    ClientLeft      =   1095
  7.    ClientTop       =   3270
  8.    ClientWidth     =   9480
  9.    Icon            =   "mlist4.frx":0000
  10.    LinkTopic       =   "MDIForm1"
  11.    Begin VB.PictureBox ButtonBar 
  12.       Align           =   3  'Align Left
  13.       BorderStyle     =   0  'None
  14.       Height          =   6270
  15.       Left            =   0
  16.       ScaleHeight     =   6270
  17.       ScaleWidth      =   1515
  18.       TabIndex        =   2
  19.       Top             =   525
  20.       Width           =   1515
  21.       Begin VB.PictureBox Buttons 
  22.          BorderStyle     =   0  'None
  23.          BeginProperty Font 
  24.             Name            =   "MS Sans Serif"
  25.             Size            =   13.5
  26.             Charset         =   0
  27.             Weight          =   400
  28.             Underline       =   0   'False
  29.             Italic          =   0   'False
  30.             Strikethrough   =   0   'False
  31.          EndProperty
  32.          Height          =   555
  33.          Index           =   4
  34.          Left            =   0
  35.          ScaleHeight     =   555
  36.          ScaleWidth      =   1575
  37.          TabIndex        =   7
  38.          Top             =   2490
  39.          Width           =   1575
  40.       End
  41.       Begin VB.PictureBox Buttons 
  42.          BorderStyle     =   0  'None
  43.          BeginProperty Font 
  44.             Name            =   "MS Sans Serif"
  45.             Size            =   13.5
  46.             Charset         =   0
  47.             Weight          =   400
  48.             Underline       =   0   'False
  49.             Italic          =   0   'False
  50.             Strikethrough   =   0   'False
  51.          EndProperty
  52.          Height          =   555
  53.          Index           =   3
  54.          Left            =   0
  55.          ScaleHeight     =   555
  56.          ScaleWidth      =   1575
  57.          TabIndex        =   6
  58.          Top             =   2280
  59.          Width           =   1575
  60.       End
  61.       Begin VB.PictureBox Buttons 
  62.          BorderStyle     =   0  'None
  63.          BeginProperty Font 
  64.             Name            =   "MS Sans Serif"
  65.             Size            =   13.5
  66.             Charset         =   0
  67.             Weight          =   400
  68.             Underline       =   0   'False
  69.             Italic          =   0   'False
  70.             Strikethrough   =   0   'False
  71.          EndProperty
  72.          Height          =   555
  73.          Index           =   2
  74.          Left            =   -45
  75.          ScaleHeight     =   555
  76.          ScaleWidth      =   1575
  77.          TabIndex        =   5
  78.          Top             =   1335
  79.          Width           =   1575
  80.       End
  81.       Begin VB.PictureBox Buttons 
  82.          BorderStyle     =   0  'None
  83.          BeginProperty Font 
  84.             Name            =   "MS Sans Serif"
  85.             Size            =   13.5
  86.             Charset         =   0
  87.             Weight          =   400
  88.             Underline       =   0   'False
  89.             Italic          =   0   'False
  90.             Strikethrough   =   0   'False
  91.          EndProperty
  92.          Height          =   555
  93.          Index           =   1
  94.          Left            =   15
  95.          ScaleHeight     =   555
  96.          ScaleWidth      =   1575
  97.          TabIndex        =   4
  98.          Top             =   765
  99.          Width           =   1575
  100.       End
  101.       Begin VB.PictureBox Buttons 
  102.          BorderStyle     =   0  'None
  103.          BeginProperty Font 
  104.             Name            =   "MS Sans Serif"
  105.             Size            =   13.5
  106.             Charset         =   0
  107.             Weight          =   400
  108.             Underline       =   0   'False
  109.             Italic          =   0   'False
  110.             Strikethrough   =   0   'False
  111.          EndProperty
  112.          Height          =   555
  113.          Index           =   0
  114.          Left            =   30
  115.          ScaleHeight     =   555
  116.          ScaleWidth      =   1575
  117.          TabIndex        =   3
  118.          Top             =   240
  119.          Width           =   1575
  120.       End
  121.    End
  122.    Begin VB.PictureBox Title 
  123.       Align           =   1  'Align Top
  124.       BorderStyle     =   0  'None
  125.       Height          =   525
  126.       Left            =   0
  127.       ScaleHeight     =   525
  128.       ScaleWidth      =   9480
  129.       TabIndex        =   0
  130.       Top             =   0
  131.       Width           =   9480
  132.       Begin VB.Label Label1 
  133.          Alignment       =   2  'Center
  134.          Caption         =   "List/X+ Sample Program"
  135.          BeginProperty Font 
  136.             Name            =   "MS Sans Serif"
  137.             Size            =   18
  138.             Charset         =   0
  139.             Weight          =   400
  140.             Underline       =   0   'False
  141.             Italic          =   0   'False
  142.             Strikethrough   =   0   'False
  143.          EndProperty
  144.          Height          =   465
  145.          Left            =   1515
  146.          TabIndex        =   1
  147.          Top             =   30
  148.          Width           =   7935
  149.       End
  150.    End
  151. Attribute VB_Name = "MDIForm1"
  152. Attribute VB_GlobalNameSpace = False
  153. Attribute VB_Creatable = False
  154. Attribute VB_PredeclaredId = True
  155. Attribute VB_Exposed = False
  156. Option Explicit
  157. Private Declare Function SetCapture Lib "user32" (ByVal hwnd As Long) As Long
  158. Private Declare Function ReleaseCapture Lib "user32" () As Long
  159. Private m_hascapture As Integer
  160. Private m_mousedown As Boolean
  161. Private m_selectedform As Integer
  162. Private Sub LoadForm(f As Form)
  163.    f.Move 0, 0, Me.ScaleWidth, Me.ScaleHeight
  164. '   f.WindowState = 2
  165.    f.Show
  166.    f.ZOrder 0
  167. End Sub
  168. Private Sub Buttons_Click(Index As Integer)
  169.    Dim i As Integer
  170.    m_hascapture = -1
  171.    If (Index = m_selectedform) Then
  172.       Exit Sub
  173.    End If
  174.    If (m_selectedform <> -1) Then
  175.       i = m_selectedform
  176.       m_selectedform = -1
  177.       Buttons(i).Refresh
  178.    End If
  179.    m_selectedform = Index
  180.    Select Case (Index)
  181.       Case 0
  182.          LoadForm frmOwnDraw
  183.       Case 1
  184.          LoadForm frmColumns
  185.       Case 2
  186.          LoadForm frmThreedFX
  187.       Case 3
  188.          LoadForm frmColors
  189.       Case 4
  190.          LoadForm frmSort
  191.    End Select
  192. End Sub
  193. Private Sub Buttons_MouseDown(Index As Integer, Button As Integer, Shift As Integer, x As Single, y As Single)
  194.    m_mousedown = True
  195.    Buttons(Index).Refresh
  196. End Sub
  197. Private Sub Buttons_MouseMove(Index As Integer, Button As Integer, Shift As Integer, x As Single, y As Single)
  198.    If (m_hascapture <> Index) Then
  199.       Call SetCapture(Buttons(Index).hwnd)
  200.       m_hascapture = Index
  201.       Buttons(Index).Refresh
  202.    Else
  203.       If (x < 0 Or y < 0 Or x > Buttons(Index).ScaleWidth Or y > Buttons(Index).ScaleHeight) Then
  204.          Call ReleaseCapture
  205.          m_hascapture = -1
  206.          Buttons(Index).Refresh
  207.       End If
  208.    End If
  209. End Sub
  210. Private Sub Buttons_MouseUp(Index As Integer, Button As Integer, Shift As Integer, x As Single, y As Single)
  211.    m_mousedown = False
  212.    Buttons(Index).Refresh
  213. End Sub
  214. Private Sub Buttons_Paint(Index As Integer)
  215.    Dim s As String
  216.    Dim factive As Boolean
  217.    If (Index = m_hascapture) Then
  218.       factive = True And Not m_mousedown
  219.    Else
  220.       factive = False
  221.    End If
  222.    Select Case Index
  223.       Case 0
  224.          s = "Draw!"
  225.       Case 1
  226.          s = "Columns"
  227.       Case 2
  228.          s = "3D Effects"
  229.       Case 3
  230.          s = "Colors"
  231.       Case 4
  232.          s = "Sorting"
  233.    End Select
  234.    If (Index = m_selectedform) Then
  235.       Buttons(Index).ForeColor = RGB(0, 0, 255)
  236.    Else
  237.       Buttons(Index).ForeColor = RGB(0, 0, 128)
  238.    End If
  239.    Buttons(Index).CurrentX = (Buttons(Index).ScaleWidth - Buttons(Index).TextWidth(s)) / 2
  240.    Buttons(Index).CurrentY = (Buttons(Index).ScaleHeight - Buttons(Index).TextHeight(s)) / 2
  241.    Buttons(Index).Print s
  242.    If (factive) Then
  243.       Draw3DRect Buttons(Index), 0, 0, Buttons(Index).Width, Buttons(Index).Height, Not factive
  244.    End If
  245. End Sub
  246. Private Sub MDIForm_Load()
  247.    Dim i As Integer
  248.       
  249.    If (Screen.Width > MDIForm1.Width) Then
  250.       MDIForm1.Left = (Screen.Width - MDIForm1.Width) / 2
  251.    Else
  252.       MDIForm1.Left = 0
  253.    End If
  254.    If (Screen.Height > MDIForm1.Height) Then
  255.       MDIForm1.Top = (Screen.Height - MDIForm1.Height) / 5
  256.    Else
  257.       MDIForm1.Top = 0
  258.    End If
  259.    Buttons(0).Top = 0
  260.    Buttons(0).Left = 0
  261.    Buttons(0).Width = ButtonBar.Width
  262.    For i = 1 To 4
  263.       Buttons(i).Top = Buttons(i - 1).Top + Buttons(i - 1).Height
  264.       Buttons(i).Left = 0
  265.       Buttons(i).Width = ButtonBar.Width
  266.       Buttons(i).Height = Buttons(i - 1).Height
  267.    Next
  268.    m_hascapture = -1
  269.    m_selectedform = -1
  270.    Me.Show
  271.    DoEvents
  272.    Buttons_Click 0
  273.    Buttons_Paint 0
  274.    Buttons(0).SetFocus
  275. End Sub
  276.